<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>立即质检</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../../res/layuis/css/layui.css">
   <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
   <script type="text/javascript" src="../../res/layuis/layui.js" charset="utf-8"></script>
</head>
<body>
<input type="button" class="layui-btn" id="submitDetail" value="立即质检" style="width: 100px;" onclick="submitDetail()">

<div class="demoTable" style="margin-top: 10px;">
        
<table class="layui-table"  lay-filter="demo" id="NowQualityTesting">
   
</table>
<input type="hidden" id="qualityTestingText" style="width: 100%;">
<script type="text/javascript">
/**
 * 从地址栏传值的代码
 * @param param
 * @returns
 */

function getParameter(param){
	var query = window.location.search;
	var iLen = param.length;
	var iStart = query.indexOf(param);
	if (iStart == -1)
		return "";
	iStart += iLen + 1;
	var iEnd = query.indexOf("&", iStart);
	if (iEnd == -1)
		return query.substring(iStart);
	return query.substring(iStart, iEnd);
}
var qtId=null;
$(function(){
	
	qtId=getParameter("qtId")
	
	if($("#qualityTestingText").val()==""){
		var url="../../listenProductionDetail/findProductionDetail.action";
		  var data={"prodId":getParameter("prodId")};
		  $.post(url,data,function(mes){
			  $.each(mes.data,function(i,item){
				  $("#qualityTestingText").val($("#qualityTestingText").val()+item.muId+","+item.muName+","+item.pdNumber+","+0+","+"100%"+"#")
			  })
		  },"json")
	}
})

layui.use('table',function(){
	  var table = layui.table;
	  var form = layui.form;
	  
	  table.render({
		    elem: '#NowQualityTesting'
		    	,page: true
		    ,url:'../../listenProductionDetail/findProductionDetail.action?prodId='+getParameter("prodId")
		    ,cols: [[
		    	   {field:'muId'}
			      ,{field:'muName',title: '物品名称'}
			      ,{field:'pdNumber',title: '总数量'}
			      ,{title: '未通过数量',templet:'#qtNoNumbers'}
			      ,{title: '通过率',templet:'#qtPass'}
		    ]],id: 'iss',done: function (res, curr, count) {
		    	 $("[data-field='muId']").css('display','none');
		    	 
		    	 
		    },
		  });
	  
	 
});
</script>
 <script type="text/html" id="qtNoNumbers">
 <input type="text" name="title" id="noNumber_{{d.muId}}" required lay-verify="required" value="0" autocomplete="off" class="layui-input" style="border:0px;" onkeyup="input(this,event)">
</script>
<script type="text/html" id="qtPass">
	<div><span id="pass_{{d.muId}}">100</span>%</div>
</script>

 </div>
<script src="../../res/js/manufactureQualityTesting/NowQualityTesting.js" charset="utf-8"></script>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

</body>
</html>